<?php
/* include_once('./core/common.php');



for($c = 2;$c <= 9999;$c++){
	
	$sql = "INSERT INTO `pages` (`PageName`, `PageUrl`)VALUES ('$c', $c);";
			//检测数据库是否有对应的username和password的sql
			$ret = run_sql($sql);
			
			
}

			echo 88888;
 */


?> 

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>示例演示</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- 注意：项目正式环境请勿引用该地址 -->
  <link href="//unpkg.com/layui@2.7.4/dist/css/layui.css" rel="stylesheet">
</head>
<body>
           
<table class="layui-hide" id="data" lay-filter="data"></table>
 
<script type="text/html" id="toolbarDemo">
  <div class="layui-btn-container">
    <button class="layui-btn layui-btn-sm" lay-event="add">获取选中行数据</button>
  </div>
</script>
 
<script type="text/html" id="cityTpl">
  <select id="demoCity1" class="layui-border" lay-ignore>
    <option value="浙江杭州">浙江杭州</option>
    <option value="江西南昌">江西南昌</option>
    <option value="湖北武汉">湖北武汉</option>
  </select>
</script>
 
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>     
          
<!-- 注意：项目正式环境请勿引用该地址 -->
<script src="//unpkg.com/layui@2.7.4/dist/layui.js"></script>

<script>
layui.use(['table', 'dropdown'], function(){
  var table = layui.table;
  var dropdown = layui.dropdown;

  
  // 创建渲染实例
  table.render({
    elem: '#data'
    ,url:'https://layuion.com/static/json/table/demo1.json' // 此处为静态模拟数据，实际使用时需换成真实接口
    ,toolbar: '#toolbarDemo'
    ,defaultToolbar: ['filter', 'exports', 'print', {
      title: '帮助'
      ,layEvent: 'LAYTABLE_TIPS'
      ,icon: 'layui-icon-tips'
    }]
    ,height: 'full-200' // 最大高度减去其他容器已占有的高度差
    ,cellMinWidth: 80
    ,totalRow: true // 开启合计行
    ,page: true
    ,cols: [[
      {type: 'checkbox', fixed: 'left'}
      ,{field:'id', fixed: 'left', width:80, title: 'ID', sort: true, totalRowText: '合计：'}
      ,{field:'username', width:80, title: '用户'}
      ,{field:'joinTime', title:'加入时间', width: 120}
      ,{fixed: 'right', title:'操作', width: 125, minWidth: 125, toolbar: '#barDemo'}
    ]]
    
  });
  
  // 工具栏事件
  table.on('toolbar(data)', function(obj){
    var id = obj.config.id;
    var checkStatus = table.checkStatus(id);
    switch(obj.event){
      case 'add':
        var data = checkStatus.data;
		
		layer.open({
        title: '添加',
        type: 2,
        area: ['80%','80%'],
        content: './add/?PageID='+data.PageID
      });
		
      break;
    };
  });
 
 

});
</script>

</body>
</html>